package com.example.mapper;

import com.example.entity.Routes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoutesMapper {

    /**
     * 新增
     */
    int insert(Routes routes); //可以让新增之后，将id进行返回

    /**
     * 更新
     */
    void updateById(Routes routes);

    /**
     * 删除
     */
    @Delete("delete from routes where id = #{id}")
    void deleteById(Integer id);

    /**
     * 查询所有
     */
    List<Routes> selectAll(Routes routes);

    /**
     * 批量删除
     */
    void deleteBatch(@Param("ids") List<Integer> ids);

    /**
     * 根据id查询
     */
    @Select("select * from routes where id = #{id}")
    Routes selectById(Integer id);
}
